<template>
  <div class="playdisc">
    <div :class="{ act: playing }" class="arm">
      <img src="../assets/arm.png" alt="" />
    </div>
    <div :class="{ active: playing }" class="disc">
      <div class="back">
        <div class="content">
          <img :src="(currentSong.picUrl||currentSong.al.picUrl)|picUrl" alt="" />
        </div>
      </div>
    </div>
    <div class="btns">
      <i class="fonticon iconfont icon-aixin"></i>
      <i class="fonticon iconfont icon-xiazai"></i>
      <i class="fonticon iconfont icon-yinle1"></i>
      <i class="fonticon iconfont icon-liaotian"></i>
      <i class="fonticon iconfont icon-gengduo-shuxiang"></i>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    currentSong: Object,
    playing: Boolean,
  },
};
</script>

<style lang="less" scoped>
.playdisc {
  height: 438.69px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;
  position: relative;
  .arm {
    width: 25%;
    margin-left: 50px;
    transition-duration: 0.5s;
    transform: rotate(-30deg);
    transform-origin: 10px 10px;
    &.act {
      transform: rotate(0);
    }
  }
  .disc {
    z-index: -1;
    animation: discanimate 4s linear infinite;
    animation-play-state: paused;
    &.active {
      animation-play-state: running;
    }
    .back {
      width: 250px;
      height: 250px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #000;
      background-image: linear-gradient(
        rgba(50, 50, 50, 0.5) 0%,
        #000 40%,
        #000 50%,
        rgba(50, 50, 50, 0.5) 100%
      );
      box-shadow: 0 0 0px 10px rgba(150, 150, 150, 0.2);
      .content {
        box-sizing: content-box;
        width: 160px;
        height: 160px;
        border-radius: 50%;
        overflow: hidden;
      }
    }
  }
  .btns {
    width: 100%;
    justify-self: flex-end;
    display: flex;
    justify-content: space-between;
    .fonticon {
      font-size: 40px;
      color: white;
      &:first-child {
        font-size: 33px;
        line-height: 40px;
      }
    }
  }
}
@keyframes discanimate {
  from {
    transform:translateY(-60px) rotateZ(0deg);
  }
  to {
    transform:translateY(-60px) rotateZ(360deg);
  }
}
</style>